package com.bdqn.config;

import com.bdqn.interceptor.AuthorizationInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class InterceptorConfig implements WebMvcConfigurer {
    String[] pathPatterns = {"/**"};
    String[] excludePathPatterns = {"/login", "/api/**", "/static/**", "/css/**", "/js/**", "/fonts/**", "/images/**", "/localcss/**", "/localjs/**"};
    @Override
    public void addInterceptors(InterceptorRegistry registry){
        registry.addInterceptor(new AuthorizationInterceptor()).addPathPatterns(pathPatterns).excludePathPatterns(excludePathPatterns);
    }
}
